package staticFiled;

/**
 * 学生类
 */
class Student {
    // 普通成员变量
    public String name;

    public Student(String name) {
        this.name = name;
    }
}

/**
 * 学生类
 */
class StudentV2 {
    // static修饰的成员变量
    public static String name;
}

class Main{

    public static void main(String[] args) {
        Student s1 = new Student("张飞");
        Student s2 = new Student("李四");

        s1.name = "关羽";
        System.out.println("学生s1的名字：" + s1.name);
        System.out.println("学生s2的名字：" + s2.name);

        System.out.println("====================");
        // static修饰的成员变量
        StudentV2 v1 = new StudentV2();
        v1.name = "关羽";

        StudentV2 v2 = new StudentV2();
        v2.name = "刘备";

        System.out.println("学生v1的名字：" + v1.name);
        System.out.println("学生v2的名字：" + v2.name);

    }



}